<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<c:set var="ctx" value="${pageContext.request.contextPath}" />
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="${ctx}/css/common.css" />
<jsp:include page="../inc.jsp"></jsp:include>
	<jsp:include page="../head.jsp"/>
<meta http-equiv="X-UA-Compatible" content="edge" />
<title>充值审核查询页面</title>
<style>
	.searchBox{
		margin-top:15px;
		height:50px;
	}
	.searchBox li{
		float:left;
		margin-left:5px;
	}
	/*弹出框样式*/
	.rechagePage{
		width:632px;
		height:268px;
		border:1px solid #3287ca;
		position:absolute;
		top:100px;
		left:300px;
		z-index:3;
		display:none;
	}
	.rechargeHeader{
		width:632px;
		height:20px;
		background:#00B2EE;
		color:white;
		line-height:20px;
	}
	.rechargeContent li{
		width:320px;
		height:30px;
		/* background:red; */
		margin-top:5px;
		margin-left:5px;
	}
	.contentBox{
		width:632px;
		height:248px;
		background:white;
	}
	.rechargeContent{
		width:300px;
		height:127px;
		margin-left:150px;
	}
</style>
<script type="text/javascript">
	$(function(){
		//加载列表信息
		dataGrid = $('#table').datagrid({
			url:'${ctx}/tradeList/checkPage?tradeType=3&rand='+Math.random(),
			width:1600,
			striped : true,
			singleSelect : true,
			idField : 'flightIdList',
			pageList : [5,10,20],
			//sortName : 'id',
			//sortOrder : 'asc',
			method : 'get',
			toolbar:'#toolbar',
			pagination:true,
			columns:[[{
				width : '80',
				title : 'id',
				field : 'id',
				hidden : true,
				sortable : true
			},{
				width : '150',
				title : '支付单号',
				align : 'center',
				field : 'payOrderNumber',
			},{
				width : '135',
				title : '采购商',
				align : 'center',
				field : 'organizationName',
			},{
				width : '130',
				title : '类型',
				align : 'center',
				field : 'scheduleId',
				formatter : function(value,row){
					var str=CommonConverter.toTradeStr(row.tradeType);
					return str;
				}
			},{
				width : '135',
				title : '交易信息',
				align : 'center',
				field : 'bb',
				formatter:function(value,row){
					var accountNumber=CommonConverter.toEmptyString(row.accountNumber);
					var accountName=CommonConverter.toEmptyString(row.accountName);
					var payType=CommonConverter.toPaystr(row.payType);
					var income=CommonConverter.toEmptyString(row.income);
					var str="<p>账号:"+accountNumber+"</p>"+
							"<p>账户名称:"+accountName+"</p>"+
							"<p>支付方式:"+payType+"</p>"+
							"<p>平台到账:"+income+"</p>";
					return str;
				}
			},{
				width : '135',
				title : '操作日期',
				align : 'center',
				field : 'createTime'
			},{
				width : '90',
				title : '账户余额（元）',
				align:'center',
				field : 'accountBalance'
			},{
				width : '120',
				title : '状态',
				align:'center',
				field : 'placeHolder',
				formatter : function(value,row){
					var status=CommonConverter.toRechargestr(row.status);
					return status;
				}   
			},{
				width : '100',
				title : '操作',
				align:'center',
				field : 'aa',
				formatter:function(value,row){
					var str='<span class="mynewBtn" onclick=detail("'+row.id+'")>查看</span>';
					if(row.status==0){
						str='<span class="mynewBtn" onclick=check('+row.id+',\''+row.payOrderNumber+'\')>审核</span>';
					};
					return str;
				}  
			}] ]
		});
		//点击查询
		$("#query").click(function(){
			var payOrderNumber=$("#_orderNumber").val();
			var buyer=$("#buyer").val();
			var startDate=$("#_startTime").datebox("getValue");
			var endDate=$("#_endTime").datebox("getValue");
			var status=$("#status").val();
			$("#table").datagrid("load",{"payOrderNumber":payOrderNumber,"buyer":buyer,"startDate":startDate,"endDate":endDate,"status":status});
		});
	});
	//查看
	function detail(id){
		layer.open({
			type: 2,
			title: ['审核','background-color:#00B2EE; color:#fff;'],
			shadeClose: true,
			shade: 0.5,
			area: ['500px', '300px'],
			content: ['${ctx}/np/checkPageDetail/'+id, 'no']
		});
	};
	//审核
	function check(id,number){
		layer.open({
			type: 2,
			title: ['审核','background-color:#00B2EE; color:#fff;'],
			shadeClose: true,
			shade: 0.5,
			area: ['500px', '400px'],
			content: ['${ctx}/np/checkPage/'+id, 'no'],
			end:function(){
				$("#table").datagrid("reload");
				$("#table").datagrid('clearSelections');
			}
		});
	};
</script>
</head>
<body>
<div>
		 <div>
			<ul class="searchBox">
					<li>支付单号：<input  id="_orderNumber" name="charterType" class="easyui-textbox"/></li>
					<li>采购商：<input  id="buyer" name="charterType" class="easyui-textbox"/></li>
					<li>
						操作日期 ：<input class="easyui-datebox" id="_startTime" style="width: 120px" />
						至<input class="easyui-datebox" id="_endTime" style="width: 120px" /></li>
					<li>
						状态：
						<select id="status" style="width: 83px;">
							<option value="">全部</option>
							<option value="-1">审核不通过</option>
							<option value="0">待审核</option>
							<option value="1">已充值</option>
						</select>
					</li>
					<li>
					<li><button class='query' id="query">查询</button></li>
				</ul>
			</div>
			 <div>
				<table id="table" class="easyui-datagrid"></table>
			</div>
			<div class="rechagePage">
				<div class="rechargeHeader"></div>
				<div class="contentBox">
					<ul class="rechargeContent"> 
						<li>金额：<input class="money" id="money" type="text" placeholder="请输入金额"/></li>
						<li>账号：<input class="money" id="accountNumber" type="text" placeholder="请输入账号"/></li>
						<li>账户名称：<input class="money" id="accountName" type="text" placeholder="请输入账户名称"/></li>
						<li id="explain"></li>
					</ul>
					<button class="add_minus" id="affirm">确认</button>
					<button class="backOne" id="cancel">取消</button>
				</div>
			</div>
		</div>
<jsp:include page="../footer.jsp"/>
</body>
</html>